const axios=require('axios')
// 请求分类导航
const class_list=()=>{
    return axios.get('/mip/v2/index_entry')
}
// const getList = () => axios.get("/api/index.json")
// 请求附近商家
const near_list=()=>{
    return axios.get('/mip/shopping/restaurants?latitude=1&longitude=1')//https://elm.cangdu.org/shopping/restaurants
}
// 搜索餐馆
const search_food=(keys)=>{
    return axios.get('/mip/v4/restaurants?geohash=31.22967,121.4762&keyword='+keys)
}
// 获取当前城市
const get_localcity=()=>{
    return axios.get('/mip/v1/cities?type=guess')
}
// 获取热门城市
const get_hotcity=()=>{
    return axios.get('/mip/v1/cities?type=hot')
}
// 获取所有城市
const get_allcity=()=>{
    return axios.get('/mip/v1/cities?type=group')
}
// 获取城市信息   https://elm.cangdu.org/v1/cities/1
const get_cityinfo=(cid)=>{
    return axios.get('/mip/v1/cities/'+cid)
}
// 获取搜索地址  https://elm.cangdu.org/v1/pois?city_id=1&keyword=%E8%BF%AA%E5%A3%AB%E5%B0%BC&type=search
const get_search_d=(cid,key)=>{
    return axios.get('/mip/v1/pois?city_id='+cid+'&keyword='+key+'&type=search')
}
// 获取餐馆分类
const get_foods=(offset)=>{
    return axios.get('/mip/shopping/restaurants?latitude=31.22967&longitude=121.4762&offset='+offset)
}



export {
    class_list,
    near_list,
    search_food,
    get_localcity,
    get_hotcity,
    get_allcity,
    get_cityinfo,
    get_search_d,
    get_foods
}